package o;

import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import androidx.annotation.NonNull;
import com.bumptech.glide.Glide;
import java.security.MessageDigest;

public class wv implements si<Drawable> {
    private final si<Bitmap> ˊ;
    private final boolean ॱ;

    public wv(si<Bitmap> siVar, boolean z) {
        this.ˊ = siVar;
        this.ॱ = z;
    }

    public si<BitmapDrawable> ˋ() {
        return this;
    }

    @NonNull
    public tx<Drawable> ˏ(@NonNull Context context, @NonNull tx<Drawable> txVar, int i, int i2) {
        Drawable drawable = (Drawable) txVar.ˋ();
        tx ˋ = wt.ˋ(Glide.ˎ(context).ˋ(), drawable, i, i2);
        if (ˋ != null) {
            tx ˏ = this.ˊ.ˏ(context, ˋ, i, i2);
            if (!ˏ.equals(ˋ)) {
                return ˋ(context, ˏ);
            }
            ˏ.ॱॱ();
            return txVar;
        } else if (!this.ॱ) {
            return txVar;
        } else {
            throw new IllegalArgumentException("Unable to convert " + drawable + " to a Bitmap");
        }
    }

    private tx<Drawable> ˋ(Context context, tx<Bitmap> txVar) {
        return wy.ॱ(context.getResources(), txVar);
    }

    public boolean equals(Object obj) {
        if (!(obj instanceof wv)) {
            return false;
        }
        return this.ˊ.equals(((wv) obj).ˊ);
    }

    public int hashCode() {
        return this.ˊ.hashCode();
    }

    public void ॱ(@NonNull MessageDigest messageDigest) {
        this.ˊ.ॱ(messageDigest);
    }
}
